"""
API v1模块
"""
from fastapi import APIRouter

from app.api.v1.admin import auth as admin_auth
from app.api.v1.admin import banners, products, news, users, cases, solutions, jobs, packages, faqs, upload
from app.api.v1.portal import home, banners as portal_banners, products as portal_products, news as portal_news, packages as portal_packages


# 管理后台路由
admin_router = APIRouter()
admin_router.include_router(admin_auth.router, prefix="/admin/auth", tags=["管理-认证"])
admin_router.include_router(upload.router, prefix="/admin/upload", tags=["管理-文件上传"])
admin_router.include_router(banners.router, prefix="/admin/banners", tags=["管理-Banner"])
admin_router.include_router(products.router, prefix="/admin/products", tags=["管理-产品"])
admin_router.include_router(news.router, prefix="/admin/news", tags=["管理-新闻"])
admin_router.include_router(cases.router, prefix="/admin/cases", tags=["管理-案例"])
admin_router.include_router(solutions.router, prefix="/admin/solutions", tags=["管理-解决方案"])
admin_router.include_router(jobs.router, prefix="/admin/jobs", tags=["管理-招聘"])
admin_router.include_router(packages.router, prefix="/admin/packages", tags=["管理-套餐"])
admin_router.include_router(faqs.router, prefix="/admin/faqs", tags=["管理-常见问题"])
admin_router.include_router(users.router, prefix="/admin/users", tags=["管理-用户"])

# 门户网站路由
portal_router = APIRouter()
portal_router.include_router(home.router, prefix="/portal", tags=["门户-首页"])
portal_router.include_router(portal_banners.router, prefix="/portal/banners", tags=["门户-Banner"])
portal_router.include_router(portal_products.router, prefix="/portal/products", tags=["门户-产品"])
portal_router.include_router(portal_news.router, prefix="/portal/news", tags=["门户-新闻"])
portal_router.include_router(portal_packages.router, prefix="/portal", tags=["门户-套餐"])


# 合并路由
router = APIRouter()
router.include_router(admin_router)
router.include_router(portal_router)


# 为了兼容main.py导入
class AdminModule:
    router = admin_router

class PortalModule:
    router = portal_router

admin = AdminModule()
portal = PortalModule()

